<template>
  <div>
    <h3>通过inject接收到的:{{ message }}</h3>
    <button @click="fn('小川')">传递给班主任</button>
    <SonTest :value="123" @aaa="fnaaa" @change="changeEvent" />
  </div>
</template>
<script>
import SonTest from './components/sonTest'
export default {
  components: {
    SonTest
  },
  methods: {
    fnaaa() {
      console.log('fnaaa')
    },
    changeEvent() {
      console.log('changeEvent')
    }
  },
  inject: {
    message: {
      type: String
    },
    fn: {
      type: Function
    }
  }
}
</script>
<style></style>
